﻿using Wolfpack.Core.Configuration;
using Wolfpack.Core.Interfaces.Entities;
using Wolfpack.Core;

namespace Wolfpack.Contrib.Publishers.Email
{
    public class EmailPublisherConfigurationDiscovery : PluginDiscoveryBase<EmailConfiguration, EmailPublisher>
    {
        protected override EmailConfiguration GetConfiguration()
        {
            return new EmailConfiguration
                       {
                           Enabled = true,
                           Environment = "Environment Telltale",
                           FriendlyId = "CHANGEME!",
                           FromAddress = "changeme@yourdomain.com",
                           FromName = "Wolfpack Agent",
                           MailSubject = "Wolfpack Notification",
                           Domain =  string.Empty,
                           Password = string.Empty,
                           UserName = string.Empty,
                           UseSsl = false,
                           Port = 25,
                           SmtpHost = "localhost",
                           TemplatePath = "EmailPublisherTemplates",
                           ToAddress = "changeme@yourdomain.com"
                       };
        }

        protected override void Configure(ConfigurationEntry entry)
        {
            entry.Name = "EmailPublisher";
            entry.Description = "This publisher will send an email when Wolfpack generates a notification.";
            entry.Tags.AddIfMissing(SpecialTags.PUBLISHER, "Email");
        }
    }
}